package com.zyy.service;

import com.alibaba.fastjson.JSON;

/**
 * @author zyy
 * @date 2021/2/24 下午2:29
 * @description
 */
public class JSONSerializer implements  Serializer{
    @Override
    public byte[] serialize(Object object) {
        return JSON.toJSONBytes(object);
    }

    @Override
    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        return JSON.parseObject(bytes, clazz);
    }
}
